package ar.uade.edu.fain.ad.server.dao.jpa;

import ar.uade.edu.fain.ad.server.business.Comision;
import ar.uade.edu.fain.ad.server.dao.ComisionDAO;
import ar.uade.edu.fain.ad.server.dao.entity.ComisionEntity;
import ar.uade.edu.fain.ad.server.dao.entity.MozoEntity;

public class ComisionJpaDAO 
		extends GenericJpaDAO<Comision, ComisionEntity, Long> 
		implements ComisionDAO {

	public ComisionJpaDAO() {
		super(ComisionEntity.class);
	}

	@Override
	protected ComisionEntity toEntity(final Comision business) {
		final ComisionEntity entity = new ComisionEntity();
		entity.setId(business.getId());
		entity.setFecha(business.getFecha());
		entity.setTotal(business.getTotal());
		entity.setMozo((MozoEntity) getSession().get(
				MozoEntity.class, business.getMozo().getId()));
		return entity;
	}

	@Override
	protected Comision toBusiness(final ComisionEntity entity) {
		return null;
	}

}
